﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace CanTeenShow
{
    public class HttpMsg
    {
        private static HttpMsg instance;
        private HttpMsg() { }

        public static HttpMsg Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new HttpMsg();
                }
                return instance;
            }
        }
        /// <summary>
        /// 获取库存
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public string getDeviceStockMsg(string data)
        {
            try
            {
                var Stock = HttpClient.Instance.HttpPostRaw("getDeviceStock", data, true);
                return Stock;
            }
            catch (Exception)
            {
                return "";
            }
        }
        /// <summary>
        /// 保存物料和设备状态
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public string saveDeviceMatterMsg(string data)
        {
            try
            {
                var Matter = HttpClient.Instance.HttpPostRaw("saveDeviceMatter", data);
                return Matter;
            }
            catch (Exception)
            {
                return "";
            }
        }
        public string sendEmailMsg(string data)
        {
            try
            {
                var Matter = HttpClient.Instance.HttpPostRaw("sendEmail", data);
                return Matter;
            }
            catch (Exception)
            {
                return "";
            }
        }
        /// <summary>
        /// 所有排队订单信息
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public string deviceOrderQueueListMsg(string data)
        {
            try
            {
                var QueueList = HttpClient.Instance.HttpPostRaw("deviceOrderQueueList", data, true);
                return QueueList;
            }
            catch (Exception)
            {
                return "";
            }
        }
        /// <summary>
        /// 所有排队订单信息
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public string deviceOrderQueueListMsgCoffee(string data)
        {
            try
            {
                var QueueList = HttpClient.Instance.HttpPostRaw("deviceOrderQueueList", data, true, "http://jaka.motonbackend.top/swoft/api/motong/");
                return QueueList;
            }
            catch (Exception)
            {
                return "";
            }
        }
        /// <summary>
        /// 修改订单状态
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public string editDeviceOrderStatusMsg(string data)
        {
            try
            {
                var editDevice = HttpClient.Instance.HttpPostRaw("editDeviceOrderStatus", data);
                return editDevice;
            }
            catch (Exception)
            {
                return "";
            }
        }
        /// <summary>
        /// 扫码排队
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public string orderQueueMsg(string data)
        {
            try
            {
                var Queue = HttpClient.Instance.HttpPostRaw("orderQueue", data);
                return Queue;
            }
            catch (Exception)
            {
                return "";
            }
        }
    }
}
